Server for refining model in terminal and operation method thereof

ABSTRACT

A method performed by a server is provided. The method includes, in response to input information being processed by the first model in the terminal, receiving, from the terminal, intermediate data output from a first layer included in a shared portion of the first model, obtaining the first model and a second model, which are pretrained by including the shared portion, obtaining correct answer data for the input information by inputting the intermediate data as an output of the first layer to the first layer included in the shared portion of the second model, in response to the intermediate data being input as the output of the first layer to the first layer included in the shared portion of the first model, refining the first model so that the correct answer data may be output from the first model, and transmitting information about the refined first model to the terminal.

TECHNICAL FIELD

The disclosure relates to a server for refining a model stored in aterminal and an operation method thereof.

BACKGROUND ART

According to on-device artificial intelligence (AI) technology, withouttransmitting and receiving data to and from a server, operations may beperformed by an AI model stored in a terminal. The terminal using theon-device AI technology does not transmit the collected data to theoutside but operates the data by itself, and thus has excellentcharacteristics in terms of data processing speed and a user's personalinformation protection.

Whenever an operation is performed by the AI model in the terminal,information related to the performed operation is transmitted to theserver, and thus, information for refining the AI model in the terminalgenerated in the server may be provided to the terminal.

However, because the information related to the operation transmittedfrom the terminal to the server may include the user's personalinformation, there is a risk of the personal information being leaked inthe process of transmission to the server. Thus, there is a need for amethod of refining an AI model in a terminal, by which the risk ofpersonal information leakage is reduced.

The above information is presented as background information only toassist with an understanding of the disclosure. No determination hasbeen made, and no assertion is made, as to whether any of the abovemight be applicable as prior art with regard to the disclosure.

DESCRIPTION OF EMBODIMENTS Technical Problem

Aspects of the disclosure are to address at least the above-mentionedproblems and/or disadvantages and to provide at least the advantagesdescribed below. Accordingly, an aspect of the disclosure is to providea server for refining a model in a terminal and an operation methodthereof.

Another aspect of the disclosure is to provide a computer-readablerecording medium having recorded thereon a program for executing theoperation method on a computer. The disclosure is not limited to theabove aspects, and there may be other aspects of the disclosure.

Technical Solution to Problem

Additional aspects will be set forth in part in the description whichfollows and, in part, will be apparent from the description, or may belearned by practice of the presented embodiments.

According to a first aspect of the disclosure, there is provided amethod, performed by a server, of generating information for refining afirst model in a terminal, the method including: when input informationinput to the first model is processed by the first model in theterminal, receiving, from the terminal, intermediate data output from afirst layer included in a shared portion of the first model; obtainingthe first model and a second model, which are models pretrained byincluding the shared portion therein; obtaining correct answer data forthe input information by inputting the intermediate data as an output ofthe first layer to the first layer included in the shared portion of thesecond model; when the intermediate data is input as the output of thefirst layer to the first layer included in the shared portion of thefirst model, refining the first model so that the correct answer data isoutput from the first model; and transmitting information about therefined first model to the terminal.

According to a second aspect of the disclosure, there is provided amethod, performed by a terminal, of refining a first model, the methodincluding: when input information input to the first model is processedby the first model in the terminal, obtaining intermediate data outputfrom a first layer included in a shared portion of the first model;transmitting the intermediate data to a server; and receiving, from theserver, information for refining the first model, wherein theinformation for refining the first model is obtained based on correctanswer data obtained by inputting the intermediate data as an output ofthe first layer to the first layer included in the shared portion of thesecond model.

Also, according to a third aspect of the disclosure, there is provided aserver for generating information for refining a first model in aterminal, the server including: a communication unit configured toreceive, from the terminal, when input information input to the firstmodel is processed by the first model in the terminal, intermediate dataoutput from a first layer included in a shared portion of the firstmodel; a memory storing the first model and a second model, which aremodels pretrained by including the shared portion therein; and at leastone processor configured to obtain correct answer data for the inputinformation by inputting the intermediate data as an output of the firstlayer to the first layer included in the shared portion of the secondmodel, when the intermediate data is input as the output of the firstlayer to the first layer included in the shared portion of the firstmodel, refine the first model so that the correct answer data is outputfrom the first model, and control the communication unit to transmitinformation about the refined first model to the terminal.

Also, according to a fourth aspect of the disclosure, there is provideda terminal for refining a first model, the terminal including: a memorystoring the first model; at least one processor configured to, wheninput information input to the first model is processed by the firstmodel in the terminal, obtain intermediate data output from a firstlayer included in a shared portion of the first model; and acommunication unit configured to, when the intermediate data istransmitted to a server, receive, from the server, information forrefining the first model, wherein the information for refining the firstmodel is obtained based on correct answer data obtained by inputting theintermediate data as an output of the first layer to the first layerincluded in the shared portion of the second model.

Also, according to a fifth aspect of the disclosure, there is provided acomputer-readable recording medium having stored therein a program forperforming the method of the first aspect or the second aspect.

Other aspects, advantages, and salient features of the disclosure willbecome apparent to those skilled in the art from the following detaileddescription, which, taken in conjunction with the annexed drawings,discloses various embodiments of the disclosure.

BRIEF DESCRIPTION OF DRAWINGS

The above and other aspects, features, and advantages of certainembodiments of the disclosure will be more apparent from the followingdescription taken in conjunction with the accompanying drawings, inwhich:

FIG. 1 is a diagram illustrating an example of refining a first model ina terminal, according to an embodiment of the disclosure;

FIG. 2 is a diagram illustrating an example of generating a first modeland a second model, according to an embodiment of the disclosure;

FIG. 3 is a block diagram for explaining an internal configuration of aserver, according to an embodiment of the disclosure;

FIG. 4 is a block diagram for explaining an internal configuration of aterminal, according to an embodiment of the disclosure;

FIG. 5 is a block diagram for explaining an internal configuration of aterminal, according to an embodiment of the disclosure;

FIG. 6 is a diagram illustrating a method, performed by a server, ofgenerating and transmitting information for refining a first model in aterminal, according to an embodiment of the disclosure;

FIG. 7 is a block diagram illustrating an example of a method ofgenerating information for refining a first model, based on a pluralityof second models, according to an embodiment of the disclosure; and

FIG. 8 is a block diagram illustrating an example of refining a decoderincluded in a terminal, according to an embodiment of the disclosure.

Throughout the drawings, it should be noted that like reference numbersare used to depict the same or similar elements, features, andstructures.

MODE OF DISCLOSURE

The following description with reference to the accompanying drawings isprovided to assist in a comprehensive understanding of variousembodiments of the disclosure as defined by the claims and theirequivalents. It includes various specific details to assist in thatunderstanding but these are to be regarded as merely exemplary.Accordingly, those of ordinary skill in the art will recognize thatvarious changes and modifications of the various embodiments describedherein can be made without departing from the scope and spirit of thedisclosure. In addition, descriptions of well-known functions andconstructions may be omitted for clarity and conciseness.

The terms and words used in the following description and claims are notlimited to the bibliographical meanings, but, are merely used by theinventor to enable a clear and consistent understanding of thedisclosure. Accordingly, it should be apparent to those skilled in theart that the following description of various embodiments of thedisclosure is provided for illustration purpose only and not for thepurpose of limiting the disclosure as defined by the appended claims andtheir equivalents.

It is to be understood that the singular forms “a,” “an,” and “the”include plural referents unless the context clearly dictates otherwise.Thus, for example, reference to “a component surface” includes referenceto one or more of such surfaces.

Throughout the disclosure, the expression “at least one of a, b or c”indicates only a, only b, only c, both a and b, both a and c, both b andc, all of a, b, and c, or variations thereof.

Hereinafter, embodiments of the disclosure will be described in detailwith reference to the accompanying drawings such that one of ordinaryskill in the art may readily make implementations thereof. However, itshould be understood that the disclosure may be embodied in differentways and is not limited to embodiments described herein. In addition,portions irrelevant to the description are omitted from the drawings forclarity, and like components are denoted by like reference numeralsthroughout the specification.

Throughout the specification, when an element is referred to as being“connected to” another element, the element may be “directly connectedto” the other element, or the element may also be “electricallyconnected to” the other element with an intervening elementtherebetween. In addition, when an element is referred to as “including”or “comprising” another element, unless otherwise stated, the elementmay further include or comprise yet another element rather than precludethe yet other element.

A function related to artificial intelligence (AI) according to thedisclosure is performed by a processor and a memory. The processor maybe configured as one or more processors. In this case, the one or moreprocessors may be a general-purpose processor such as a centralprocessing unit (CPU), an application processor (AP), or a digitalsignal processor (DSP), a graphics processor such as a graphicsprocessing unit (GPU) or a vision processing unit (VPU), or an AIprocessor such as a neural processing unit (NPU). The one or moreprocessors control input data to be processed according to pre-definedoperation rules or an Al model stored in the memory. Alternatively, whenthe one or more processors are AI processors, the AI processors may bedesigned in a hardware structure specialized for processing a specificAl model.

The pre-defined operation rules or the Al model may be made throughtraining. Here, the expression “made through training” means that anexisting AI model is trained based on a learning algorithm by using alarge number of pieces of training data and thus made into a pre-definedoperation rule or an AI model, which is set to fulfill an intendedfeature (or purpose). Such training may be performed by a device itselfin which AI according to the disclosure is performed, or may beperformed via a separate server/system. Examples of the learningalgorithm include, but are not limited to, supervised learning,unsupervised learning, semi-supervised learning), or reinforcementlearning.

An AI model may include a plurality of neural network layers. Each ofthe neural network layers includes a plurality of weight values andperforms a neural network operation via an operation between anoperation result of a previous layer and the plurality of weight values.The weight values of the neural network layers may be optimized via aresult of training the Al model. For example, the weight values may berefined to reduce or minimize a loss value or a cost value obtained bythe Al model during a training process. An artificial neural network mayinclude, but is not limited to, a deep neural network (DNN), forexample, a convolutional neural network (CNN), a recurrent neuralnetwork (RNN), a restricted Boltzmann machine (RBM), a deep beliefnetwork (DBN), a bidirectional recurrent deep neural network (BRDNN), ora deep Q-network.

Hereinafter, the disclosure will be described in detail with referenceto the accompanying drawings.

FIG. 1 is a diagram illustrating an example for refining a first modelin a terminal, according to an embodiment of the disclosure.

Referring to FIG. 1, a terminal 2000 according to an embodiment of thedisclosure may perform various operations by using a first model 220.For example, when input information according to a user input is inputto the first model 220, output information may be output from the firstmodel 220, and an operation corresponding to the output information maybe performed.

The input information according to an embodiment of the disclosure mayinclude information input to the first model 220 to perform anoperation. Also, the output information is a result of processing thefirst model 220, and the operation may be performed based on the outputinformation.

The first model 220 according to an embodiment of the disclosure may beone of at least one AI model for performing various operations in theterminal 2000. For example, the first model 220 may be an AI model forvarious operations that may be performed by the terminal 2000, such as avoice recognition model, a natural language processing model, an imagerecognition model, or the like. The disclosure is not limited thereto,and the first model 220 may be one of various types of AI models.

The terminal 2000 according to an embodiment of the disclosure may beimplemented in various forms. For example, the terminal 2000 used hereinmay be, but is not limited to, a smart TV, a set-top box, a mobilephone, a tablet personal computer (PC), a digital camera, a laptopcomputer, a desktop computer, an e-book terminal, a digital broadcastingterminal, a personal digital assistant (PDA), a portable multimediaplayer (PMP), a navigation system, an MP3 player, a wearable device, orthe like.

According to an embodiment of the disclosure, when an operation of theterminal 2000 is performed by an AI model present in an external server1000, the terminal 2000 may transmit input information of the AI modelto the server 1000 and receive output information of the AI model toperform an operation based on the output information. However, accordingto an embodiment of the disclosure, according to on-device AItechnology, the first model 220 for performing the operation is mountedin the terminal 2000, and thus, the input information of the first model220 may not be transmitted to the server 1000 and may be processed inthe terminal 2000.

Thus, according to an embodiment of the disclosure, the inputinformation that may include sensitive information of a user may not beleaked to the outside during a transmission process. Also, according toan embodiment of the disclosure, a process of transmitting the inputinformation to the server 1000 or receiving the output information fromthe server 1000 is not performed, and thus, an operation may beperformed with a smaller operation volume than in a case where the inputinformation is processed by the server 1000.

However, the first model 220 mounted in the terminal 2000 according toan embodiment of the disclosure may be a relatively small-sized AI modelaccording to a relatively lower level of performance (e.g., data storagecapacity, operation speed) of the terminal 2000 than that of the server1000. For example, the first model 220 may be an AI model including arelatively small number of nodes and neural network layers. Thus,according to an embodiment of the disclosure, the first model 220 has arelatively small size, and thus, a probability of outputting outputinformation for performing an operation suitable for a user may berelatively low.

According to an embodiment of the disclosure, in order to supplementshortcomings of the first model 220, the server 1000 may provide theterminal 2000 with information for refining the first model 220, byusing a second model 110 having better performance than that of thefirst model 220. According to an embodiment of the disclosure, based onthe information provided from the server 1000, the first model 220 inthe terminal 2000 is continuously refined, and thus, as a case of usingthe second model 110 having better performance, suitable outputinformation may be output even through the first model 220 having asmall size.

The second model 110 according to an embodiment of the disclosure has arelatively larger size than that of the first model 220, and thus, aprobability of outputting output information suitable for a user may berelatively higher. The second model 110 according to an embodiment ofthe disclosure may be processed by the server 1000 having relativelyhigh performance, and thus may be an AI model including a larger numberof nodes and neural network layers than the first model 220.

The server 1000 according to an embodiment of the disclosure may firstrefine, as an AI model identical to the first model 220 in the terminal2000, the first model 120 mounted in the server 1000, by using thesecond model 110. According to an embodiment of the disclosure, thefirst model 120 of the server 1000 may be refined so that, with respectto identical input information, output information which is identical tothe output information output from the second model 110 may be outputfrom the first model 120. Also, the server 1000 may obtain, based on therefined first model 120, information for refining the first model 220 inthe terminal 2000 and transmit the information to the terminal 2000.

The server 1000 according to an embodiment of the disclosure may obtain,as correct answer data, a value output when the input information inputto the first model 220 in the terminal 2000 is input to the second model110. Also, the server 1000 according to an embodiment of the disclosuremay refine the first model 120 so that the correct answer data may beoutput from the first model 120 when the input information is input tothe first model 120 of the server 1000.

The server 1000 according to an embodiment of the disclosure receives,from the terminal 2000, input-related information of the first model220, which is used to perform an operation in the terminal 2000, andthus may refine the first model 120 of the server 1000. However,according to an embodiment of the disclosure, because the inputinformation of the first model 220 may include personal information of auser, when the input information is transmitted to the server 1000,there is a risk of leakage during a transmission process.

Thus, according to an embodiment of the disclosure, other informationfor refining the first models 120 and 220 instead of the inputinformation of the first model 220 is transmitted from the terminal 2000to the server 1000, so that the first models 120 and 220 may be refined.According to an embodiment of the disclosure, the server 1000 receives,from the terminal 2000, intermediate data generated in a shared portion100 of the first model 220 instead of the input information of the firstmodel 220, and may refine the first model 120 of the server 1000.

The shared portion 100 according to an embodiment of the disclosure is aportion equally included in the first models 120 and 220 and the secondmodel 110, and may include at least one neural network layer.

The AI model according to an embodiment of the disclosure may include atleast one neural network layer including at least one node. Each neuralnetwork layer according to an embodiment of the disclosure includes atleast one node, and values input to the AI model may be processed ineach node included in the AI model and then output. For example, a value(x) input to each node is processed according to an equation, i.e.,y=ax+b, based on a weight value (a) and a bias value (b), which arepreset for each node, and thus, an output value (y) may be output fromeach node. The disclosure is not limited thereto, and an input value maybe processed and output according to various equations, weight values,and bias values, which are set for each node.

The AI model according to an embodiment of the disclosure may include aninput layer, an output layer, and at least one hidden layer. The inputlayer according to an embodiment of the disclosure may be a layer fordirectly processing information input to the AI model. Also, a hiddenlayer may be a layer for processing information between the input layerand the output layer. Also, the output layer may be a layer for directlyoutputting output information of the AI model by finally processing theinformation processed in the input layer and the hidden layer.

The shared portion 100 according to an embodiment of the disclosure maybe set as at least one neural network layer including an input layeramong the at least one neural network layer constituting the firstmodels 120 and 220. Also, the second model 110 according to anembodiment of the disclosure may be generated to include the sharedportion 100 identical to the shared portion 100 of the first models 120and 220.

For example, when the first models 120 and 220 include an input layer,100 hidden layers, and an output layer, the shared portion 100 may beset as the input layer and 9 hidden layers. The disclosure is notlimited thereto, and the shared portion 100 may be set as various layersamong layers constituting the first models 120 and 220.

According to an embodiment of the disclosure, instead of inputinformation which may include personal information of a user, valuesoutput from a layer among a plurality of layers included in the sharedportion 100 are intermediate data and may be transmitted to the server1000. For example, according to y=ax+b, output values (y) generated ineach node included in the layer may be transmitted as the intermediatedata.

When receiving the intermediate data from the terminal 2000, the server1000 according to an embodiment of the disclosure may identify a layerfrom which y values of the intermediate data are output. Also, based onthe identified layer, the server 1000 may obtain correct answer data forinput information corresponding to the intermediate data. For example,the server 1000 may obtain the correct answer data by inputting theintermediate data as an output of the identified layer.

The intermediate data according to an embodiment of the disclosure mayfurther include, in addition to the y values, information foridentifying the layer of the shared portion 100, the layer from whichthe y values are output. For example, the intermediate data may includevalues of (4, [0.3, 0.23, 0.9, . . . ]). In this case, 4 is a value foridentifying a layer of the shared portion 100, and values in the squarebrackets may be y values output from a fourth layer.

According to an embodiment of the disclosure, when the y values of theintermediate data are output values for a third layer among layers ofthe shared portion 100, in the shared portion 100 of the second model110, the intermediate data is input to the fourth layer in which theoutput values of the third layer are processed, and thus, correct answerdata may be output from the second model 110. Also, in the first model120 of the server 1000, when the intermediate data is input to thefourth layer of the shared portion 100, the first model 120 may berefined so that the correct answer data may be output.

According to an embodiment of the disclosure, each of the sharedportions 100 respectively included in the models 110, 120, and 220includes identical layers and nodes. Thus, each layer included in theshared portion 100 may output equal output values (y) between the models110, 120, and 220 with respect to identical input information. Forexample, a first layer of the shared portion 100 equally included ineach of the models 110, 120, and 220 may output equal output values withrespect to identical input information. Thus, the intermediate data istransmitted to the server 1000 instead of the input information, andthus, correct answer data corresponding to the input information may beoutput from the second model 110.

The intermediate data according to an embodiment of the disclosure mayinclude output values for a layer randomly selected from among layers ofthe shared portion 100. Thus, even when input information input to thefirst model 220 is the same, intermediate data including differentvalues may be transmitted to the server 1000. For example, according toa first operation performed using the first model 220 in the terminal2000, output values for the first layer among layers of the sharedportion 100 may be transmitted as intermediate data, but afterwards,according to a second operation, output values for a fifth layer of theshared portion 100 may be transmitted as intermediate data.

Thus, according to an embodiment of the disclosure, in order to performthe first operation and the second operation, even when inputinformation input to the first model 220 is identical to each other,output values for different layers may be transmitted as intermediatedata, and thus, the intermediate data transmitted for each operation mayinclude different values. Thus, according to an embodiment of thedisclosure, because it is difficult to restore the input informationinput to the first model 220 even when the intermediate data is leakedto outside during a transmission process, a security level may befurther increased.

The server 1000 according to an embodiment of the disclosure maygenerate information for refining the first model 220 in the terminal2000, based on information related to the refined first model 120.According to an embodiment of the disclosure, the information forrefining the first model 220 in the terminal 2000 may includeinformation required to change the first model 220 in the terminal 2000so that the first model 220 is identical to the refined first model 120.For example, the information for refining the first model 220 in theterminal 2000 may include a difference value between the first model 120before refinement and the first model 120 after the refinement. Also,when the first model 120 is refined, the information for refining thefirst model 220 in the terminal 2000 may include information about datamodified in the first model 120. The disclosure is not limited thereto,and the information for refining the first model 220 in the terminal2000 may include various types of information.

The intermediate data according to an embodiment of the disclosure maybe obtained whenever the first model 220 is used to perform an operationin the terminal 2000, and transmitted to the server 1000. According toan embodiment of the disclosure, whenever input information is processedby the first model 220 in response to a user input and outputinformation is output from the first model 220, intermediate dataincluding a value output from a layer randomly selected from amonglayers of the shared portion 100 may be generated. Thus, wheneverintermediate data is generated, the terminal 2000 may transmit theintermediate data to the server 1000 and refine the first model 220.

The first model 120 of the server 1000 according to an embodiment of thedisclosure may also be refined based on, without limiting to theintermediate data received from the terminal 2000, intermediate datareceived from other terminals of other users (e.g., the users withsimilar motion patterns or similar preference) similar to a user of theterminal 2000. The disclosure is not limited thereto, and the firstmodel 120 of the server 1000 may be refined based on intermediate datareceived from various types of terminals performed in an environmentsimilar to that of the terminal 2000.

Thus, the first model 220 in the terminal 2000 may be continuouslyrefined based on information about the first model 120 refined byintermediate data received from other terminals even when the firstmodel 220 is not used. Also, although the first model 220 in theterminal 2000 is intermittently used and thus intermediate data isgenerated less, the first model 220 may be continuously refined based onthe intermediate data received from other terminals.

FIG. 2 is a diagram illustrating an example of generating a first modeland a second model, according to an embodiment of the disclosure.

Referring to FIG. 2, a server 1000 according to an embodiment of thedisclosure may first generate a first model 120, based on training data200 for training the first model 120 and a second model 110.

The training data 200 according to an embodiment of the disclosure mayinclude information about a pair of input information and outputinformation for training the first model 120. The disclosure is notlimited thereto, and the training data 200 may include various types ofdata for training the first model 120 and the second model 110.

According to an embodiment of the disclosure, after the first model 120is generated based on the training data 200, the server 1000 may set theshared portion 100 in the first model 120. Also, the second model 110including the shared portion 100 set in the first model 120 as it is maybe trained based on the training data 200. The second model 110according to an embodiment of the disclosure may be generated based onthe training data 200 while including the shared portion 100 as it iswithout any modification. The second model 110 according to anembodiment of the disclosure includes more nodes or layers than thefirst model 120, and thus has a greater operation volume than that ofthe first model 120, but may output a value with high accuracy.

The shared portion 100 according to an embodiment of the disclosure maybe set to include an input layer among layers constituting the firstmodel 120. The disclosure is not limited thereto, and the shared portion100 may be set as variously determined layers including the input layeramong the layers constituting the first model 120.

When the shared portion 100 according to an embodiment of the disclosureincreases, an area of the second model 110 generated and modified basedon the training data 200 decreases, and thus, performance of the secondmodel 110 may be lowered. In contrast, when the shared portion 100increases, a range of a layer that may be randomly selected increaseswhen intermediate data is transmitted to refine the first model 220 ofFIG. 1, and thus, a security level may be further improved.

Thus, according to an embodiment of the disclosure, a suitable size ofthe shared portion 100 may be set based on at least one of theperformances of the second model 110 trained including the sharedportion 100 or the security level when the intermediate data istransmitted.

For example, when it is determined that performance of the second model110 is significantly lowered compared to a security level due to a largesize of the shared portion 100 included in the second model 110, theshared portion 100 may be reset to have a smaller size than before inthe first model 120. Also, the second model 110 may be retrained andgenerated based on the reset shared portion 100.

In contrast, when it is determined that a security level is low due to asmall size of the shared portion 100 included in the second model 110,the shared portion 100 may be reset to have a larger size than before inthe first model 120, and the second model 110 may be retrained based onthe reset shared portion 100.

The first model 120 generated according to an embodiment of thedisclosure may be transmitted to the terminal 2000. Also, the server1000 may generate information for refining the first model 220transmitted to the terminal 2000 by using the first model 120 and thesecond model 110, and may transmit the information to the terminal 2000.

FIG. 3 is a block diagram for explaining an internal configuration of aserver, according to an embodiment of the disclosure.

Referring to FIG. 3, a server 1000 may include a processor 1300, acommunication unit 1500, and a memory 1700. However, not all thecomponents illustrated in FIG. 3 are not necessary components of theserver 1000. The server 1000 may be implemented by more components orless components than the components illustrated in FIG. 3.

The processor 1300 generally controls overall operations of the server1000. For example, the processor 1300 may take overall control of thememory 1700, the communication unit 1500, and the like by executingprograms stored in the memory 1700.

The server 1000 may include at least one processor 1300. For example,the server 1000 may include various types of processors such as a CPU, aGPU, and an NPU.

The processor 1300 may be configured to process commands of a computerprogram by performing basic arithmetic, logic, and input/outputoperations. The commands may be provided from the memory 1700 to theprocessor 1300 or may be received via the communication unit 1500 andprovided to the processor 1300. For example, the processor 1300 may beconfigured to execute the commands according to program codes stored ina recording device such as memory.

The processor 1300 according to an embodiment of the disclosure maycontrol the communication unit 1500 to receive, from the terminal 2000,when input information is processed by a first model in the terminal2000, intermediate data output from a first layer included in a sharedportion. According to an embodiment of the disclosure, whenever anoperation of using the first model is performed in the terminal 2000,the generated intermediate data may be transmitted to the server 1000.The first layer according to an embodiment of the disclosure is randomlydetermined from among a plurality of layers included in the sharedportion by the terminal 2000, and thus, the intermediate data may betransmitted to the server 1000.

Also, the processor 1300 may obtain the first model and a second model,which are models pretrained by including the shared portion therein, andmay obtain correct answer data for the input information of the firstmodel by inputting, as an output of the first layer, the intermediatedata received from the terminal 2000 in the first layer included in theshared portion of the second model.

Each of the shared portions respectively included in the first andsecond models according to an embodiment of the disclosure may includeidentical nodes and layers. Thus, according to an embodiment of thedisclosure, a value output from the shared portion by inputting theinput information to the shared portion of the second model may be equalto a value output from the shared portion by inputting the intermediatedata to the first layer of the shared portion of the second model. Thus,the intermediate data is transmitted to the server 1000 instead of theinput information being transmitted to the server 1000, and thus,correct answer data for refinement of the first model may be obtainedfrom the second model.

Also, when the intermediate data is input to a second layer included inthe shared portion of the first model, the processor 1300 may refine thefirst model so that correct answer data may be output from the firstmodel. The processor 1300 according to an embodiment of the disclosuremay generate information for refining the first model in the terminal2000, based on the refined first model, and may control thecommunication unit 1500 to transmit the information to the terminal2000.

Also, the processor 1300 according to an embodiment of the disclosuremay set the shared portion in the first model trained based on trainingdata, and may generate the second model equally including the set sharedportion based on the training data. The shared portion according to anembodiment of the disclosure may be determined to have a suitable size,based on performance of the second model and a security level that maybe determined according to a range of a layer that may be randomlyselected from the shared portion. When it is determined that the sharedportion according to an embodiment of the disclosure is not suitablebased on the performance of the second model and the security level, theshared portion may be reset in the first model, and then, based on thereset shared portion, the second model may be regenerated based on thetraining data.

The communication unit 1500 may include one or more components allowingthe server 1000 to communicate with the terminal 2000 or an externaldevice (not shown).

The memory 1700 may store programs for processing and control performedby the processor 1300 and may also store data that is received from ortransmitted to the terminal 2000.

The memory 1700 according to an embodiment of the disclosure may storethe first model and the second model. The first model stored in theserver 1000 may be identical to the first model stored in the terminal2000. Also, the second model includes more nodes and layers than thefirst model, and thus may be a model with higher accuracy.

The memory 1700 may include at least one of a flash memory type storagemedium, a hard disk type storage medium, a multimedia card micro typestorage medium, card type memory (for example, Secure Digital (SD)memory, eXtreme Digital (XD) memory, or the like), random access memory(RAM), static random access memory (SRAM), read-only memory (ROM),electrically erasable programmable read-only memory (EEPROM),programmable read-only memory (PROM), magnetic memory, a magnetic disk,or an optical disk.

FIG. 4 is a block diagram for explaining an internal configuration of aterminal, according to an embodiment of the disclosure.

FIG. 5 is a block diagram for explaining an internal configuration of aterminal, according to an embodiment of the disclosure.

Referring to FIG. 4, a terminal 2000 may include a processor 2300, acommunication unit 2500, and a memory 2700. However, not all thecomponents illustrated in FIG. 4 are not necessary components of theterminal 2000. The terminal 2000 may be implemented by more componentsor less components than the components illustrated in FIG. 4.

Referring to FIG. 5, a terminal 2000 according to an embodiment of thedisclosure may further include, in addition to a processor 2300, acommunication unit 2500, and a memory 2700, a user input unit 2100, anoutput unit 2200, a sensing unit 2400, and an audio/video (A/V) inputunit 2600.

The user input unit 2100 refers to a means for inputting data for a userto control the terminal 2000. For example, the user input unit 2100 mayinclude, but is not limited to, a keypad, a dome switch, a touch pad (atouch capacitive type, a pressure resistive type, an infrared beamsensing type, a surface acoustic wave type, an integral strain gaugetype, a piezoelectric type, or the like), a jog wheel, a jog switch, orthe like.

According to an embodiment of the disclosure, the user input unit 2100may receive a user input for performing an operation according to thefirst model.

The output unit 2200 may output an audio signal, a video signal, or avibration signal, and the output unit 2200 may include a display 2210, asound output unit 2220, and a vibration motor 2230.

The display 2210 displays and outputs information processed by theterminal 2000. According to an embodiment of the disclosure, the display2210 may display information related to information output according tothe first model.

When the display 2210 and a touch pad form a layer structure and thusconstitute a touch screen, the display 2210 may also be used as an inputdevice in addition to being used as an output device. The display 2210may include at least one of a liquid crystal display, a thin filmtransistor-liquid crystal display, an organic light-emitting diode, aflexible display, a three-dimensional (3D) display, or anelectrophoretic display. Also, the terminal 2000 may include two or moredisplays 2210 according to an implementation type of the terminal 2000.

The sound output unit 2220 outputs audio data received from thecommunication unit 2500 or stored in the memory 2700. According to anembodiment of the disclosure, the sound output unit 2220 may output, asan audio signal, information related to information output according tothe first model.

The vibration motor 2230 may output a vibration signal. Also, when atouch is input to a touch screen, the vibration motor 2230 may output avibration signal. According to an embodiment of the disclosure, thevibration motor 2230 may output, as a vibration signal, informationrelated to information output according to the first model.

The processor 2300 generally controls overall operations of the terminal2000. For example, the processor 2300 may take overall control of theuser input unit 2100, the output unit 2200, the sensing unit 2400, thecommunication unit 2500, the A/V input unit 2600, and the like byexecuting programs stored in the memory 2700.

The terminal 2000 may include at least one processor 2300. For example,the terminal 2000 may include various types of processors such as a CPU,a GPU, and an NPU.

The processor 2300 may be configured to process commands of a computerprogram by performing basic arithmetic, logic, and input/outputoperations. The commands may be provided from the memory 2700 to theprocessor 2300 or may be received via the communication unit 2500 andprovided to the processor 2300. For example, the processor 2300 may beconfigured to execute the commands according to program codes stored ina recording device such as memory.

The processor 2300 according to an embodiment of the disclosure mayinput input information to the first model according to a user input,and may perform an operation according to information output from thefirst model. Also, when the input information is processed by the firstmodel, the processor 2300 may obtain intermediate data output from thefirst layer among layers included in the shared portion included in thefirst model. The first layer according to an embodiment of thedisclosure may be randomly selected from among the layers included inthe shared portion. When the intermediate data according to anembodiment of the disclosure is transmitted to the server 1000,information for refining the first model may be received by the terminal2000. When the information for refining the first model, which isgenerated based on the intermediate data, is received from the server1000, the processor 2300 according to an embodiment of the disclosuremay refine the first model.

The sensing unit 2400 may detect a state of the terminal 2000 or a statearound the terminal 2000, and may transmit detected information to theprocessor 2300.

The sensing unit 2400 may include, but is not limited to, at least oneof a geomagnetic sensor 2410, an acceleration sensor 2420, atemperature/humidity sensor 2430, an infrared sensor 2440, a gyroscopesensor 2450, a position sensor 2460 (for example, a global positioningsystem (GPS)), a barometric pressure sensor 2470, a proximity sensor2480, or an RGB sensor (illuminance sensor) 2490.

The communication unit 2500 may include one or more components allowingthe terminal 2000 to communicate with the server 1000 or an externaldevice (not shown). For example, the communication unit 2500 may includea short-range wireless communication unit 2510, a mobile communicationunit 2520, and a broadcast receiver 2530.

The short-range wireless communication unit 2510 may include, but is notlimited to, a Bluetooth communication unit, a Bluetooth Low Energy (BLE)communication unit, a near field communication unit, a wireless localarea network (WLAN) (Wi-Fi) communication unit, a Zigbee communicationunit, an Infrared Data Association (IrDA) communication unit, a Wi-FiDirect (WFD) communication unit, an ultra wideband (UWB) communicationunit, an Ant+ communication unit, or the like.

The mobile communication unit 2520 transmits a radio signal to andreceives a radio signal from at least one of a base station, an externalterminal, or a server on a mobile communication network. Here, the radiosignal may include various types of data according to transmission andreception of a voice call signal, a video call signal, or atext/multimedia message.

The broadcast receiver 2530 receives a broadcast signal and/orbroadcast-related information from outside via a broadcast channel. Thebroadcast channel may include a satellite channel or a terrestrialchannel. The terminal 2000 may not include the broadcast receiver 2530,according to an implementation example.

The communication unit 2500 according to an embodiment of the disclosuremay transmit intermediate data to the server 1000, and in responsethereto, may receive information for refining the first model from theserver 1000. Thus, the terminal 2000 may refine the first model used inthe terminal 2000, based on the information for refining the firstmodel.

The A/V input unit 2600 is for inputting an audio signal or a videosignal and may include a camera 2610, a microphone 2620, and the like.The camera 2610 may obtain an image frame of a still image, a movingimage, or the like through an image sensor in a video call mode or ashooting mode. An image captured through the image sensor may beprocessed by the processor 2300 or a separate image processing unit (notshown).

The microphone 2620 receives an external sound signal that is inputthereto and processes the sound signal into electrical sound data.

The memory 2700 may store programs for processing and control performedby the processor 2300 and may also store data that is input to or outputfrom the terminal 2000.

The memory 2700 according to an embodiment of the disclosure may storethe first model. The first model according to an embodiment of thedisclosure may be generated by the server 1000, transmitted to theterminal 2000, and stored in the memory 2700. Afterwards, whenever anoperation by the first model is performed, intermediate data istransmitted to the server 1000, and thus, the first model may berepeatedly refined based on information received from the server 1000.

The memory 2700 may include at least one of a flash memory type storagemedium, a hard disk type storage medium, a multimedia card micro typestorage medium, card type memory (for example, Secure Digital (SD)memory, eXtreme Digital (XD) memory, or the like), random access memory(RAM), static random access memory (SRAM), read-only memory (ROM),electrically erasable programmable read-only memory (EEPROM),programmable read-only memory (PROM), magnetic memory, a magnetic disk,or an optical disk.

The programs stored in the memory 2700 may be classified into aplurality of modules, for example, a UI module 2710, a touch screenmodule 2720, a notification module 2730, and the like, according tofunctions thereof.

The UI module 2710 may provide a specialized UI, a graphical userinterface (GUI), or the like interworking with the terminal 2000, on anapplication basis. The touch screen module 2720 may sense a touchgesture of the user on a touch screen and may transfer information aboutthe touch gesture to the processor 2300. The touch screen module 2720according to an embodiment of the disclosure may recognize and analyze atouch code. The touch screen module 2720 may be configured by separatehardware including a controller.

To sense a touch or a proximity touch with respect to the touch screen,various sensors may be arranged inside or near the touch screen. Anexample of a sensor for sensing a touch with respect to the touch screenincludes a tactile sensor. The tactile sensor refers to a sensor sensinga contact with a particular object to an extent felt by a human or to ahigher extent. The tactile sensor may sense various pieces ofinformation, such as roughness of a contact surface, hardness of acontact object, and a temperature of a contact point.

The touch gesture of the user may include tap, touch and hold, doubletap, drag, panning, flick, drag and drop, swipe, or the like.

The notification module 2730 may generate a signal for notifying theoccurrence of an event of the terminal 2000.

FIG. 6 is a diagram illustrating a method, performed by a server, ofgenerating and transmitting information for refining a first model in aterminal, according to an embodiment of the disclosure.

Referring to FIG. 6, in operation 610, a server 1000 may receiveintermediate data from a terminal 2000. When receiving the intermediatedata from the terminal 2000, the server 1000 according to an embodimentof the disclosure may generate information for refining the first model220 in the terminal 2000 and transmit the information to the terminal2000.

The intermediate data according to an embodiment of the disclosure maybe generated when the first model 220 is used to perform an operation inthe terminal 2000. For example, when input information is input to thefirst model 220 in response to a user input, values output from a layerrandomly selected from among layers included in a shared portion may beobtained as the intermediate data.

In operation 620, the server 1000 may obtain correct answer datacorresponding to input information by inputting the intermediate data toa second model.

The server 1000 according to an embodiment of the disclosure mayidentify a layer for the intermediate data, and based on the identifiedlayer, may identify a layer, to which the intermediate data is to beinput, among layers included in a shared portion of the second model.For example, when the intermediate data received from the terminal 2000includes values output from a first layer among the layers of the sharedportion, the intermediate data may be input as an output of a firstlayer identical to the first layer among the layers included in theshared portion of the second model.

The server 1000 according to an embodiment of the disclosure may obtaincorrect answer data from the second model by inputting the intermediatedata as the output of the first layer included in the shared portion ofthe second model.

In operation 630, when the intermediate data is input to the firstmodel, the server 1000 may refine the first model so that the correctanswer data obtained in operation 620 may be output. The intermediatedata according to an embodiment of the disclosure may be input to asecond layer identified, in operation 620, as a layer, to which theintermediate data is to be input, in the shared portion of the firstmodel.

In operation 640, the server 1000 may generate information for refiningthe first model in the terminal 2000, based on the first model refinedin operation 630, and transmit the generated information to the terminal2000.

FIG. 7 is a block diagram illustrating an example of a method ofgenerating information for refining a first model, based on a pluralityof second models, according to an embodiment of the disclosure.

Referring to FIG. 7, a server 1000 according to an embodiment of thedisclosure may refine a first model 120, based on a second model group720 including a plurality of second models, and generate information forrefining a first model 220 in a terminal 2000.

According to an embodiment of the disclosure, the plurality of secondmodels may be generated based on training data according to each ofdomains. The domains according to an embodiment of the disclosure may besorted according to characteristics of each operation performed by theterminal 2000. For example, the domains may be divided into a phonecall, a gallery, an alarm, etc. for each application executed in theterminal 2000. Also, based on training data collected for eachapplication, the plurality of second models may each be differentlytrained and generated.

The plurality of second models according to an embodiment of thedisclosure may be trained based on training data specified according toeach domain. Thus, more accurate correct answer data may be obtainedbased on the plurality of second models being used than one second modelbeing used.

The plurality of second models according to an embodiment of thedisclosure may also be trained and generated to equally include theshared portion 100 set in the first model 120.

When receiving intermediate data from the terminal 2000, the server 1000according to an embodiment of the disclosure may select a domain foridentifying a second model for refining the first model 120 among theplurality of second models included in the second model group 720.

A domain for a second model according to an embodiment of the disclosuremay be selected based on a third model 710 pretrained to select a domainbased on intermediate data. For example, the third model 710 may be adomain classifier (DC) model. The disclosure is not limited thereto, andthe server 1000 may select a domain of a second model, based on varioustypes of AI models.

The third model 710 according to an embodiment of the disclosure mayequally include the shared portion 100 set in the first model 120 in thesame manner as the second model. Although the third model 710 accordingto an embodiment of the disclosure may be trained based on training datafor selecting a domain of a second model, the shared portion 100 of thethird model 710 may be trained while being included in the third model710 as it is without modification.

The training data used for training the third model 710 according to anembodiment of the disclosure may include data different from trainingdata used for training a second model. The disclosure is not limitedthereto, and the training data for training the third model 710 mayinclude various types of data.

The third model 710 according to an embodiment of the disclosure mayreceive an input of intermediate data as an output of a first layer inthe shared portion 100 of the third model 710 in the same manner as in acase where intermediate data is input to the second model. According toan embodiment of the disclosure, when the intermediate data is input asthe output of the first layer to the shared portion 100 of the thirdmodel 710, information about a domain of a second model may be output.

According to an embodiment of the disclosure, based on the informationabout the domain of the second model output from the third model 710, atleast one second model may be selected from among a plurality of secondmodels 110-1, 110-2, and 110-3 included in the second model group 720.Also, when intermediate data is input to the selected at least onesecond model, correct answer data for refining the first model 120 maybe obtained.

According to an embodiment of the disclosure, based on the informationabout the domain, the plurality of second models 110-1, 110-2, and 110-3may be selected. In this case, a plurality of pieces of correct answerdata may be obtained by the plurality of second models 110-1, 110-2, and110-3. According to an embodiment of the disclosure, a representativevalue (e.g., an average value, a median value, a maximum value, etc.)for the plurality of pieces of correct answer data may be used ascorrect answer data for refining the first model 120. The disclosure isnot limited thereto, and a value obtained according to various methodsbased on the plurality of pieces of correct answer data may be used ascorrect answer data for refining the first model 120.

In contrast, when information about the domain output from the thirdmodel 710 according to an embodiment of the disclosure relates to adomain that is not suitable for refining the first model 120, arefinement operation according to an embodiment of the disclosure maynot be performed. For example, when the domain selected by the thirdmodel 710 is a domain that is preset as a domain that is not used torefine the first model 120, a refinement operation for the first model120 may not be performed on the currently received intermediate data.

In 730, the server 1000 according to an embodiment of the disclosure maydetermine whether a reliability of the correct answer data obtained fromthe second model group 720 is greater than or equal to a referencevalue. The correct answer data according to an embodiment of thedisclosure may further include information indicating reliability (e.g.,probability information on an output value).

When the reliability of the correct answer data according to anembodiment of the disclosure is greater than or equal to the referencevalue, an operation for refining the first model 120 may be performedbased on the correct answer data. In contrast, when the reliability isless than or equal to the reference value, an operation for refining thefirst model 120 may not be performed on the currently receivedintermediate data.

Thus, according to an embodiment of the disclosure, based on reliabilityof correct answer data, refinement of the first model 120 may beselectively performed.

FIG. 8 is a block diagram illustrating an example of refining a decoderincluded in a terminal, according to an embodiment of the disclosure.

Referring to FIG. 8, a terminal 2000 may perform various operations,based on an encoder 800 and a first decoder 820. For example, theterminal 2000 may translate text in a first language into a secondlanguage and output the text in the second language by using the encoder800 and the first decoder 820.

The encoder 800 according to an embodiment of the disclosure may convertthe text in the first language into context information in the form of avector, and the first decoder 820 may output, based on the contextinformation, the text in the second language.

According to an embodiment of the disclosure, the encoder 800 maycorrespond to the shared portion 100. Also, the first decoder 820 maycorrespond to the first model 220 except for the shared portion 100.Also, a second decoder 810 may correspond to the second model 110 exceptfor the shared portion 100 according to an embodiment of the disclosure.

The first decoder 820 and the second decoder 810 according to anembodiment of the disclosure may perform an operation, based oninformation output from the identical encoder 800.

According to an embodiment of the disclosure, based on a translationoperation, by the encoder 800 and the first decoder 820, the input textin the first language may be translated and output into the text in thesecond language. In this case, information output from a first layeramong at least one layer of an AI model included in the encoder 800 isintermediate data, and may be transmitted to the server 1000.

Also, the server 1000 according to an embodiment of the disclosure mayinput the intermediate data to the encoder 800 for the second decoder810. The encoder 800 to which the intermediate data is input may be anencoder for outputting context information to the second decoder 810having better performance than that of the first decoder 820. Also, theintermediate data may be input as the output of the first layer amongthe at least one layer of the AI model included in the encoder 800. Whenthe intermediate data is input to the encoder 800, the text in thesecond language output from the second decoder 810 may be obtained ascorrect answer data.

According to an embodiment of the disclosure, because the encoder 800for the second decoder 810 is identical to the encoder 800 for the firstdecoder 820, the context information, which is received from the encoder800, in the first decoder 820 may be identical to the contextinformation obtained based on the intermediate data, which is receivedfrom the encoder 800, in the second decoder 810. Thus, according to anembodiment of the disclosure, the second decoder 810 may receive aninput identical to an input of the first decoder 820 (i.e., contextinformation), and thus may output correct answer data for the input ofthe first decoder 820.

The first decoder 820 of the server 1000 according to an embodiment ofthe disclosure may be refined so that the correct answer data may beoutput based on the intermediate data. According to an embodiment, whenthe intermediate data is input to the encoder 800 of the first decoder820, the first decoder 820 may be refined so that the correct answerdata may be output. The encoder 800 to which the intermediate data isinput may be an encoder for outputting context information to the firstdecoder 820.

The server 1000 according to an embodiment of the disclosure maygenerate information for refining the first decoder 820 in the terminal2000, based on the refined first decoder 820, and transmit theinformation to the terminal 2000.

According to an embodiment of the disclosure, instead of inputinformation, intermediate data generated in an AI model is transmittedto a server, and thus, a possibility of personal information beingleaked in response to the input information being transmitted may bereduced.

A machine-readable storage medium may be provided in the form of anon-transitory storage medium. Here, the term “non-transitory storagemedium” only means that it is a tangible device and does not includesignals (e.g., electromagnetic waves), and the term does not distinguishbetween a case where data is stored semi-permanently in a storage mediumand a case where data is temporarily stored. For example, the“non-transitory storage medium” may include a buffer in which data istemporarily stored.

According to an embodiment of the disclosure, methods according tovarious embodiments disclosed herein may be provided while included in acomputer program product. The computer program product may be traded asmerchandise between a seller and a purchaser. The computer programproduct may be distributed in the form of a machine-readable storagemedium (e.g., a compact disc read only memory (CD-ROM)), or may bedistributed (e.g., downloaded or uploaded) online via an applicationstore (e.g., Play Store™) or between two user devices (e.g.,smartphones) directly. When distributed online, at least part of thecomputer program product (e.g., a downloadable application) may betemporarily generated or at least temporarily stored in amachine-readable storage medium, such as a memory of a manufacturer'sserver, a server of an application store, or a relay server.

In addition, the term such as “ . . . unit” or “ . . . portion” usedherein may refer to a hardware component such as a processor or acircuit, and/or a software component executed by the hardware componentsuch as a processor.

It will be understood by one of ordinary skill in the art that theembodiments of the disclosure are provided for illustration and may beimplemented in different ways without departing from the spirit andscope of the disclosure. Therefore, it should be understood that theforegoing embodiments of the disclosure are provided for illustrativepurposes only and are not to be construed in any way as limiting thedisclosure. For example, each component described as a single type maybe implemented in a distributed manner, and likewise, componentsdescribed as being distributed may be implemented as a combined type.

While the disclosure has been shown and described with reference tovarious embodiments thereof, it will be understood by those skilled inthe art that various changes in form and details may be made thereinwithout departing from the spirit and scope of the disclosure as definedby the appended claims and their equivalents.

1. A method, performed by a server, of generating information forrefining a first model in a terminal, the method comprising: in responseto input information input to the first model being processed by thefirst model in the terminal, receiving, from the terminal, intermediatedata output from a first layer included in a shared portion of the firstmodel; obtaining the first model and a second model, which are modelspretrained by including the shared portion therein; obtaining correctanswer data for the input information by inputting the intermediate dataas an output of the first layer to the first layer included in theshared portion of the second model; in response to the intermediate databeing input as the output of the first layer to the first layer includedin the shared portion of the first model, refining the first model sothat the correct answer data is output from the first model; andtransmitting information about the refined first model to the terminal.2. The method of claim 1, wherein the first layer is randomly determinedfrom among at least one layer included in the shared portion.
 3. Themethod of claim 1, wherein the shared portion is set among at least onelayer including an input layer, the at least one layer constituting thefirst model, and wherein the second model is a model trained byincluding the shared portion.
 4. The method of claim 1, wherein theshared portion is set based on at least one of performance of the secondmodel or a security level in response to the intermediate data beingtransmitted.
 5. The method of claim 1, wherein the first model isrefined based on reliability of the correct answer data.
 6. The methodof claim 1, wherein the obtaining of the first model and the secondmodel comprises: selecting a domain of the second model by inputting theintermediate data as an output of the first layer to the first layerincluded in the shared portion of a third model for selecting the domainof the second model; and based on the selected domain, obtaining atleast one second model from among a plurality of second models.
 7. Amethod, performed by a terminal, of refining a first model, the methodcomprising: in response to input information input to the first modelbeing processed by the first model in the terminal, obtainingintermediate data output from a first layer included in a shared portionof the first model; transmitting the intermediate data to a server; andreceiving, from the server, information for refining the first model,wherein the information for refining the first model is obtained basedon correct answer data obtained by inputting the intermediate data as anoutput of the first layer to the first layer included in the sharedportion of a second model.
 8. A server for generating information forrefining a first model in a terminal, the server comprising: acommunication circuitry configured to receive, from the terminal, inresponse to input information input to the first model being processedby the first model in the terminal, intermediate data output from afirst layer included in a shared portion of the first model; a memorystoring the first model and a second model, which comprise modelspretrained by including the shared portion therein; and at least oneprocessor configured to: obtain correct answer data for the inputinformation by inputting the intermediate data as an output of the firstlayer to the first layer included in the shared portion of the secondmodel, in response to the intermediate data being input as the output ofthe first layer to the first layer included in the shared portion of thefirst model, refine the first model so that the correct answer data isoutput from the first model, and control the communication circuitry totransmit information about the refined first model to the terminal. 9.The server of claim 8, wherein the first layer is randomly determinedfrom among at least one layer included in the shared portion.
 10. Theserver of claim 8, wherein the shared portion is set among at least onelayer including an input layer, the at least one layer constituting thefirst model, and wherein the second model is a model trained byincluding the shared portion.
 11. The server of claim 8, wherein theshared portion is set based on at least one of performance of the secondmodel or a security level in response to the intermediate data beingtransmitted.
 12. The server of claim 8, wherein the first model isrefined based on reliability of the correct answer data.
 13. The serverof claim 8, wherein the at least one processor is further configured to:select a domain of the second model by inputting the intermediate dataas an output of the first layer to the first layer included in theshared portion of a third model for selecting the domain of the secondmodel, and based on the selected domain, obtain at least one secondmodel from among a plurality of second models.
 14. A terminal forrefining a first model, the terminal comprising: a memory storing thefirst model; in response to input information input to the first modelbeing processed by the first model in the terminal, at least oneprocessor configured to obtain intermediate data output from a firstlayer included in a shared portion of the first model; and acommunication circuitry configured to, in response to the intermediatedata being transmitted to a server, receive, from the server,information for refining the first model, wherein the information forrefining the first model is obtained based on correct answer dataobtained by inputting the intermediate data as an output of the firstlayer to the first layer included in the shared portion of a secondmodel.
 15. A non-transitory computer-readable recording medium havingrecorded thereon a program for implementing the method of claim 1.